<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>从小到大排序</title>
    <script>
        function sort(array) {
            for (var i = 0; i < array.length - 1; i++) {
                for (var j = 0; j < array.length - i; j++) {
                    if (array[j] > array[j + 1]) {
                        var t = array[j]
                        array[j] = array[j + 1]
                        array[j + 1] = t
                    }
                }
            }
            return array
        }

        var array = new Array(88, 98, 33, 66, 78, 99)

        console.log(sort(array))
    </script>
</head>

<body>

</body>

</html>